home *** CD-ROM | disk | FTP | other *** search
/ 1st Multimedia Mac Shareware / Multimedia Shareware CD-ROM - BetaCorp.iso / Hypergames / AdventureStacks / ACK-stack / Adventure / card_9040.txt < prev    next >
Encoding:
Text File  |  1988-05-16  |  8.5 KB  |  386 lines

  1. -- card: 9040 from stack: in
  2. -- bmap block id: 6567
  3. -- flags: 0000
  4. -- background id: 4812
  5. -- name: !Inventory
  6. ----- HyperTalk script -----
  7. on opencard
  8.   if card field "refresh objects" of card "!globaldata" then
  9.     fixinvenitems
  10.   end if
  11.   fixinvenbuttons
  12. end opencard
  13.  
  14. on fixinvenitems
  15.   set the lockscreen to true
  16.   put empty into card field "objects"
  17.   put card field "totalobjects" of card "!globaldata" into top
  18.   put 1 into thing
  19.   put 0 into card field "weightcarried"
  20.   repeat with oof = 1 to top
  21.     put line oof of card field "objectnames" of card "!globaldata" into nextobject
  22.     put bkgnd field "location" of card nextobject into it
  23.     if it is "carried" then
  24.       put nextobject into line thing of card field "Objects"
  25.       add 1 to thing
  26.       put field "weight" of card nextObject into w
  27.       add w to card field "weightcarried"
  28.     end if
  29.   end repeat
  30.   subtract 1 from thing
  31.   if thing is 0 then
  32.     put "Nothing carried" into card field "Objects"
  33.   end if
  34.   put thing into card field "NumberCarried"
  35.   set lockscreen to false
  36. end fixinvenitems
  37.  
  38. on idle
  39.   get scroll of card field objects
  40.   divide it by 18
  41.   put trunc(it+.5) into it
  42.   multiply it by 18
  43.   set scroll of card field objects to it
  44. end idle
  45.  
  46. on fixinvenbuttons
  47.   put 3 into i
  48.   repeat until i is 15
  49.     set the hilite of card button id i to false
  50.     add 1 to i
  51.   end repeat
  52. end fixinvenbuttons
  53.  
  54.  
  55. -- part 2 (field)
  56. -- low flags: 01
  57. -- high flags: 0007
  58. -- rect: left=277 top=56 right=311 bottom=487
  59. -- title width / last selected line: 0
  60. -- icon id / first selected line: 0 / 0
  61. -- text alignment: 0
  62. -- font id: 5
  63. -- text size: 14
  64. -- style flags: 0
  65. -- line height: 18
  66. -- part name: Objects
  67. ----- HyperTalk script -----
  68. on mouseup
  69.   put the short name of me into myname
  70.   put the clickloc into here
  71.   put (item 2 of here - item 2 of the rect of me) into y
  72.   put trunc(y/(the textheight of me)) into linesdown
  73.   put trunc((the scroll of me)/(the textheight of me)) into scrolldown
  74.   put linesdown+scrolldown+1 into linenumber
  75.   put line linenumber of card field myname into thingfish
  76.   if thingfish is not "Nothing Carried" then go card thingfish
  77. end mouseup
  78.  
  79.  
  80. -- part 3 (button)
  81. -- low flags: 00
  82. -- high flags: 2005
  83. -- rect: left=260 top=57 right=74 bottom=278
  84. -- title width / last selected line: 0
  85. -- icon id / first selected line: 0 / 0
  86. -- text alignment: 1
  87. -- font id: 0
  88. -- text size: 12
  89. -- style flags: 0
  90. -- line height: 16
  91. -- part name: 
  92.  
  93.  
  94. -- part 4 (button)
  95. -- low flags: 00
  96. -- high flags: 2005
  97. -- rect: left=260 top=75 right=92 bottom=278
  98. -- title width / last selected line: 0
  99. -- icon id / first selected line: 0 / 0
  100. -- text alignment: 1
  101. -- font id: 0
  102. -- text size: 12
  103. -- style flags: 0
  104. -- line height: 16
  105. -- part name: 
  106.  
  107.  
  108. -- part 5 (button)
  109. -- low flags: 00
  110. -- high flags: 2005
  111. -- rect: left=260 top=93 right=110 bottom=278
  112. -- title width / last selected line: 0
  113. -- icon id / first selected line: 0 / 0
  114. -- text alignment: 1
  115. -- font id: 0
  116. -- text size: 12
  117. -- style flags: 0
  118. -- line height: 16
  119. -- part name: 
  120.  
  121.  
  122. -- part 6 (button)
  123. -- low flags: 00
  124. -- high flags: 2005
  125. -- rect: left=260 top=111 right=128 bottom=278
  126. -- title width / last selected line: 0
  127. -- icon id / first selected line: 0 / 0
  128. -- text alignment: 1
  129. -- font id: 0
  130. -- text size: 12
  131. -- style flags: 0
  132. -- line height: 16
  133. -- part name: 
  134.  
  135.  
  136. -- part 7 (button)
  137. -- low flags: 00
  138. -- high flags: 2005
  139. -- rect: left=260 top=129 right=146 bottom=278
  140. -- title width / last selected line: 0
  141. -- icon id / first selected line: 0 / 0
  142. -- text alignment: 1
  143. -- font id: 0
  144. -- text size: 12
  145. -- style flags: 0
  146. -- line height: 16
  147. -- part name: 
  148.  
  149.  
  150. -- part 8 (button)
  151. -- low flags: 00
  152. -- high flags: 2005
  153. -- rect: left=260 top=147 right=164 bottom=278
  154. -- title width / last selected line: 0
  155. -- icon id / first selected line: 0 / 0
  156. -- text alignment: 1
  157. -- font id: 0
  158. -- text size: 12
  159. -- style flags: 0
  160. -- line height: 16
  161. -- part name: 
  162.  
  163.  
  164. -- part 9 (button)
  165. -- low flags: 00
  166. -- high flags: 2005
  167. -- rect: left=260 top=165 right=182 bottom=278
  168. -- title width / last selected line: 0
  169. -- icon id / first selected line: 0 / 0
  170. -- text alignment: 1
  171. -- font id: 0
  172. -- text size: 12
  173. -- style flags: 0
  174. -- line height: 16
  175. -- part name: 
  176.  
  177.  
  178. -- part 10 (button)
  179. -- low flags: 00
  180. -- high flags: 2005
  181. -- rect: left=260 top=183 right=200 bottom=278
  182. -- title width / last selected line: 0
  183. -- icon id / first selected line: 0 / 0
  184. -- text alignment: 1
  185. -- font id: 0
  186. -- text size: 12
  187. -- style flags: 0
  188. -- line height: 16
  189. -- part name: 
  190.  
  191.  
  192. -- part 11 (button)
  193. -- low flags: 00
  194. -- high flags: 2005
  195. -- rect: left=260 top=201 right=218 bottom=278
  196. -- title width / last selected line: 0
  197. -- icon id / first selected line: 0 / 0
  198. -- text alignment: 1
  199. -- font id: 0
  200. -- text size: 12
  201. -- style flags: 0
  202. -- line height: 16
  203. -- part name: 
  204.  
  205.  
  206. -- part 12 (button)
  207. -- low flags: 00
  208. -- high flags: 2005
  209. -- rect: left=260 top=219 right=236 bottom=278
  210. -- title width / last selected line: 0
  211. -- icon id / first selected line: 0 / 0
  212. -- text alignment: 1
  213. -- font id: 0
  214. -- text size: 12
  215. -- style flags: 0
  216. -- line height: 16
  217. -- part name: 
  218.  
  219.  
  220. -- part 13 (button)
  221. -- low flags: 00
  222. -- high flags: 2005
  223. -- rect: left=260 top=237 right=254 bottom=278
  224. -- title width / last selected line: 0
  225. -- icon id / first selected line: 0 / 0
  226. -- text alignment: 1
  227. -- font id: 0
  228. -- text size: 12
  229. -- style flags: 0
  230. -- line height: 16
  231. -- part name: 
  232.  
  233.  
  234. -- part 14 (button)
  235. -- low flags: 00
  236. -- high flags: 2005
  237. -- rect: left=260 top=255 right=272 bottom=278
  238. -- title width / last selected line: 0
  239. -- icon id / first selected line: 0 / 0
  240. -- text alignment: 1
  241. -- font id: 0
  242. -- text size: 12
  243. -- style flags: 0
  244. -- line height: 16
  245. -- part name: 
  246.  
  247.  
  248. -- part 15 (button)
  249. -- low flags: 00
  250. -- high flags: 2005
  251. -- rect: left=260 top=273 right=290 bottom=278
  252. -- title width / last selected line: 0
  253. -- icon id / first selected line: 0 / 0
  254. -- text alignment: 1
  255. -- font id: 0
  256. -- text size: 12
  257. -- style flags: 0
  258. -- line height: 16
  259. -- part name: 
  260.  
  261.  
  262. -- part 16 (button)
  263. -- low flags: 00
  264. -- high flags: 2005
  265. -- rect: left=260 top=291 right=308 bottom=278
  266. -- title width / last selected line: 0
  267. -- icon id / first selected line: 0 / 0
  268. -- text alignment: 1
  269. -- font id: 0
  270. -- text size: 12
  271. -- style flags: 0
  272. -- line height: 16
  273. -- part name: 
  274.  
  275.  
  276. -- part 18 (button)
  277. -- low flags: 00
  278. -- high flags: 2005
  279. -- rect: left=252 top=356 right=370 bottom=270
  280. -- title width / last selected line: 0
  281. -- icon id / first selected line: 0 / 0
  282. -- text alignment: 1
  283. -- font id: 0
  284. -- text size: 12
  285. -- style flags: 0
  286. -- line height: 16
  287. -- part name: 
  288.  
  289.  
  290. -- part 20 (field)
  291. -- low flags: 01
  292. -- high flags: 0000
  293. -- rect: left=212 top=102 right=122 bottom=245
  294. -- title width / last selected line: 0
  295. -- icon id / first selected line: 0 / 0
  296. -- text alignment: 65535
  297. -- font id: 5
  298. -- text size: 14
  299. -- style flags: 0
  300. -- line height: 18
  301. -- part name: NumberCarried
  302.  
  303.  
  304. -- part 21 (field)
  305. -- low flags: 01
  306. -- high flags: 0000
  307. -- rect: left=120 top=138 right=158 bottom=154
  308. -- title width / last selected line: 0
  309. -- icon id / first selected line: 0 / 0
  310. -- text alignment: 65535
  311. -- font id: 5
  312. -- text size: 14
  313. -- style flags: 0
  314. -- line height: 18
  315. -- part name: WeightCarried
  316.  
  317.  
  318. -- part 22 (button)
  319. -- low flags: 00
  320. -- high flags: A003
  321. -- rect: left=277 top=33 right=55 bottom=487
  322. -- title width / last selected line: 0
  323. -- icon id / first selected line: 0 / 0
  324. -- text alignment: 1
  325. -- font id: 5
  326. -- text size: 14
  327. -- style flags: 0
  328. -- line height: 18
  329. -- part name: Drop
  330. ----- HyperTalk script -----
  331. on mouseUp
  332.   if card field "objects" is "Nothing here" then
  333.     fixinvenbuttons
  334.     exit mouseup
  335.   end if
  336.   put scroll of card field "Objects" into it
  337.   divide it by 18
  338.   put it into LinesUp
  339.   put false into droppedanything
  340.   put card field "yourloc" of card "!globalData" into where
  341.   repeat with num = 3 to 14
  342.     if hilite of card button id num is true then
  343.       put line ( LinesUp + num - 2 ) of card field "objects" into nextObject
  344.       if nextObject is not empty then
  345.         put where into bkgnd field "location" of card NextObject
  346.       end if
  347.     end if
  348.   end repeat
  349.   set the scroll of card field "objects" to 0
  350.   fixinvenitems
  351.   fixinvenbuttons
  352. end mouseUp
  353.  
  354.  
  355.  
  356. -- part 24 (button)
  357. -- low flags: 00
  358. -- high flags: A003
  359. -- rect: left=16 top=265 right=322 bottom=246
  360. -- title width / last selected line: 0
  361. -- icon id / first selected line: 0 / 0
  362. -- text alignment: 1
  363. -- font id: 5
  364. -- text size: 14
  365. -- style flags: 0
  366. -- line height: 18
  367. -- part name: Return to Location
  368. ----- HyperTalk script -----
  369. on mouseUp
  370.   put card field "yourloc" of card "!globaldata" into it
  371.   go card it
  372. end mouseUp
  373.  
  374.  
  375.  
  376. -- part contents for card part 20
  377. ----- text -----
  378. 0
  379.  
  380. -- part contents for card part 21
  381. ----- text -----
  382. 0
  383.  
  384. -- part contents for card part 2
  385. ----- text -----
  386. Nothing carried